<template>
	
	<!--废弃-->
	
	
	<!--<div>-->
		<!--<div style="width: 100%;height: 20px;background-color: #ebedf0;"></div>-->
		<!--<div style="padding: 20px;">-->
			<!--纵向变换页面(改完字段)-->
			<!--<div style="margin:5px 0px 0px 0px;background-color: #f5f5f5;padding: 20px;">
				<Row >
			        <Col span="24" style="text-align: left;">
						<span style="font-size: 18px;color: #1a1a1a;font-weight: 540;">评价名称：{{excelname}}</span>
					</Col>
				</Row>
				<Row style="margin:15px 0px 0px 0px;color: #666666;">
			        <Col span="6" style="text-align: left;">
						<span style="font-size: 16px;">年级：{{gradeName}}</span>
					</Col>
					<Col span="6" style="text-align: left;">
						<span style="font-size: 16px;">基数：{{baseExamName}}</span>
					</Col>
					<Col span="6" style="text-align: left;">
						<span style="font-size: 16px;">本次：{{thisExamName}}</span>
					</Col>
					<Col span="6" style="text-align: left;">
						<span style="font-size: 16px;">时间：{{createTime}}</span>
					</Col>
				</Row>
			</div>-->
			<!--<Row >
		        <Col span="24" style="text-align: right;margin-bottom:10px;">
		        	<Button style="background-color: #4496fc;" size="small" :loading="loading" @click="exportexl">
		        		<span v-if="!loading"><img style="width: 20px;margin-top: 2px;" src="../../../../../../static/img/export.png" alt="" /></span>
				        <span v-else>加载中</span>
		        	</Button>
		        </Col>
		    </Row>
			<v-table :min-height='500' :is-loading="loadingShow" is-horizontal-resize is-vertical-resize row-click-color="#3dd9cc29" style="width:100%" :title-rows="titleRows" :columns="columns" :table-data="tableData" :cell-merge="cellMerge"></v-table>
		</div>
	</div>-->
</template>

<script>
	import api from "@/components/js/Apidomain.js"
	import { getsessionstorage } from '@/components/js/Localstorage'
	
	export default{
		data(){
			return{
				excelname:"",			//查询的名字
				gradeName:"",			//查询的年级
				baseExamName:"",		//查询的基数考试名字
				thisExamName:"",		//查询的本次考试名字
				createTime:"",			//查询的评价时间
				
				loadingShow:false,				//表格获取的加载中显示隐藏
				
				loading: false,				//下载模板按钮上的加载中显示隐藏
				
				titleRows: [
                             [{fields: ['classesNo'], title: '班级', titleAlign: 'center', rowspan: 2,colspan: 1},
                              {fields: ['gradeName'], title: '等级', titleAlign: 'center'},
                              {fields: ['baseChiNum', 'thisChiNum'], title: '语文', titleAlign: 'center', colspan: 2},
                              {fields: ['baseMathNum', 'thisMathNum'], title: '数学', titleAlign: 'center', colspan: 2},
                              {fields: ['baseEngNum', 'thisEngNum'], title: '英语', titleAlign: 'center', colspan: 2},
                              
                              {fields: ['basePhyNum', 'thisPhyNum'], title: '物理', titleAlign: 'center', colspan: 2},
                              {fields: ['baseChemNum', 'thisChemNum'], title: '化学', titleAlign: 'center', colspan: 2},
                              {fields: ['baseBioNum', 'thisBioNum'], title: '生物', titleAlign: 'center', colspan: 2},
                              {fields: ['basePolNum', 'thisPolNum'], title: '政治', titleAlign: 'center', colspan: 2},
                              {fields: ['baseHisNum', 'thisHisNum'], title: '历史', titleAlign: 'center', colspan: 2},
                              {fields: ['baseGeoNum', 'thisGeoNum'], title: '地理', titleAlign: 'center', colspan: 2}
                              ],

                            [	
                              	{fields: ['gradeName'], title: '等次', titleAlign: 'center'},
                            	{fields: ['baseChiNum'], title: '基数', titleAlign: 'center'},
                              	{fields: ['thisChiNum'], title: '本次', titleAlign: 'center'},
                              	{fields: ['baseMathNum'], title: '基数', titleAlign: 'center'},
                              	{fields: ['thisMathNum'], title: '本次', titleAlign: 'center'},
                              	{fields: ['baseEngNum'], title: '基数', titleAlign: 'center'},
                              	{fields: ['thisEngNum'], title: '本次', titleAlign: 'center'},
                              	
                              	{fields: ['basePhyNum'], title: '基数', titleAlign: 'center'},
                              	{fields: ['thisPhyNum'], title: '本次', titleAlign: 'center'},
                              	{fields: ['baseChemNum'], title: '基数', titleAlign: 'center'},
                              	{fields: ['thisChemNum'], title: '本次', titleAlign: 'center'},
                              	{fields: ['baseBioNum'], title: '基数', titleAlign: 'center'},
                              	{fields: ['thisBioNum'], title: '本次', titleAlign: 'center'},
                              	
                              	{fields: ['basePolNum'], title: '基数', titleAlign: 'center'},
                              	{fields: ['thisPolNum'], title: '本次', titleAlign: 'center'},
                              	{fields: ['baseHisNum'], title: '基数', titleAlign: 'center'},
                              	{fields: ['thisHisNum'], title: '本次', titleAlign: 'center'},
                              	{fields: ['baseGeoNum'], title: '基数', titleAlign: 'center'},
                              	{fields: ['thisGeoNum'], title: '本次', titleAlign: 'center'}
                            ],

                             
                ],
                columns: [
                    {field: 'classesNo', width: 50, titleAlign: 'center', columnAlign: 'center',isResize:true},
                    {field: 'gradeName', width: 50, titleAlign: 'center', columnAlign: 'center',isResize:true}, 
                    {field: 'baseChiNum', width: 50, columnAlign: 'center',isResize:true},
                    {field: 'thisChiNum', width: 50, columnAlign: 'center' ,isResize:true},
                    {field: 'baseMathNum', width: 50, columnAlign: 'center' ,isResize:true},
                    {field: 'thisMathNum', width: 50, columnAlign: 'center',isResize:true},
                    {field: 'baseEngNum', width: 50, columnAlign: 'center',isResize:true},
                    {field: 'thisEngNum', width: 50, columnAlign: 'center',isResize:true},
                    
                    {field: 'basePhyNum', width: 50, columnAlign: 'center',isResize:true},
                  	{field: 'thisPhyNum', width: 50, columnAlign: 'center',isResize:true},
                  	{field: 'baseChemNum', width: 50, columnAlign: 'center',isResize:true},
                  	{field: 'thisChemNum', width: 50, columnAlign: 'center',isResize:true},
                  	{field: 'baseBioNum', width: 50, columnAlign: 'center',isResize:true},
                  	{field: 'thisBioNum', width: 50, columnAlign: 'center',isResize:true},
                  	
                  	{field: 'basePolNum', width: 50, columnAlign: 'center',isResize:true},
                  	{field: 'thisPolNum', width: 50, columnAlign: 'center',isResize:true},
                  	{field: 'baseHisNum', width: 50, columnAlign: 'center',isResize:true},
                  	{field: 'thisHisNum', width: 50, columnAlign: 'center',isResize:true},
                  	{field: 'baseGeoNum', width: 50, columnAlign: 'center',isResize:true},
                  	{field: 'thisGeoNum', width: 50, columnAlign: 'center',isResize:true}
                ],
                tableData: [
//                      {"classesNo":"1班","gradeName":"A","yj":"50","yb":"183","sj":"zhao","sb":"55","yj1":"15","yb1":"66"},
//                      {"classesNo":"1班","gradeName":"B","yj":"50","yb":"166","sj":"li","sb":"66","yj1":"15","yb1":"77"},
//                      {"classesNo":"1班","gradeName":"C","yj":"女","yb":"186","sj":"sun","sb":"77","yj1":"15","yb1":"88"},
//                      {"classesNo":"1班","gradeName":"D","yj":"女","yb":"188","sj":"zhou","sb":"88","yj1":"15","yb1":"99"},
                        
                        
                ],
			}
		},
		created(){
			
		},
		mounted(){
			this.excelname = getsessionstorage('excelname')
			this.gradeName = getsessionstorage('gradeName')
			this.baseExamName = getsessionstorage('baseExamName')
			this.thisExamName = getsessionstorage('thisExamName')
			this.createTime = getsessionstorage('createTime')
			this.gettablelist()
		},
		computed: {
			
		},
		methods:{
			gettablelist:function(){
				let sessionroleid = getsessionstorage('roleid');
				let sessionperformId = getsessionstorage('performId')
				if(sessionroleid && sessionperformId){
					this.loadingShow = true;
					var self = this;
	            	let url = api.apidomain+'/tqes/web/quaVerticalChange/listDto/'+sessionperformId+'/'+sessionroleid;
	            	this.$http.post(url).then(function(response) {
						if(response.data.success == true){
							self.loadingShow = false;
//		            		////console.log(response.data.data)
							self.tableData = response.data.data
			            }else if(response.data.success == false){
			            		self.loadingShow = false;
			            		self.$Message.error({
									content: response.data.msg,
									duration: 10,
									closable: true
								});
			            	}
			            })
						.catch(function(error) {
							self.loadingShow = false;
							self.$Message.error({
								content: '系统发生错误：错误码00145',
								duration: 10,
								closable: true
							});
						});
				}else{
					self.$Message.error({
							content: '系统发生错误：错误码00146',
							duration: 10,
							closable: true
						});
				}
			},
			cellMerge(rowIndex,rowData,field){
				if(field === 'classesName' && rowData[field] === '1班'){
					return {
						colSpan:1,
	                    rowSpan:4,
	                    content: '<span >1班</span>',
	                    componentName: ''
	                }
				}
				if(field === 'classesName' && rowData[field] === '2班'){
					return {
						colSpan:1,
	                    rowSpan:4,
	                    content: '<span >2班</span>',
	                    componentName: ''
	                }
				}
				if(field === 'classesName' && rowData[field] === '3班'){
					return {
						colSpan:1,
	                    rowSpan:4,
	                    content: '<span >3班</span>',
	                    componentName: ''
	                }
				}
				
			},
			exportexl:function(){
			
				let sessionroleid = getsessionstorage('roleid');
				let sessionperformId = getsessionstorage('performId');
				
				if(sessionroleid && sessionperformId){
					this.loading = true;
				
					var self = this;
	            	let url = api.apidomain+'/tqes/web/quaVerticalChange/exportExcelDto/'+sessionperformId+'/'+sessionroleid;
	            	this.$http.post(url).then(function(response) {
						if(response.data.success == true){
	//						////console.log(response.data.data)
							window.location.href = response.data.data;
							self.loading = false;
		            }else if(response.data.success == false){
		            		self.loading = false;
		            		self.$Message.error({
								content: response.data.msg,
								duration: 10,
								closable: true
							});
		            	}
		            	
					})
					.catch(function(error) {
						self.loading = false;
						self.$Message.error({
							content: '系统发生错误：错误码00147',
							duration: 10,
							closable: true
						});
					});
				}
			}
        
		}
	}
</script>

<style>
</style>